Skip to content

Fix #4891: Make scala.quoted.Expr covariant #4894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@Blaisorblade Blaisorblade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable, but I'm curious on what changes on tests/neg/i4774a.scala.

@nicolasstucki
Copy link
Contributor Author

My first guess is that the infered type is T instead of ~t.

Now type inference does not infer `~t` anymore, now it infers `T`
which is phase correct. Writing `~t` explicitly still fails as
expected (tests/neg/i4774b.scala).
@Blaisorblade Blaisorblade merged commit f4de761 into scala:master Aug 5, 2018
@Blaisorblade Blaisorblade deleted the fix-#4891 branch August 5, 2018 15:09
@Blaisorblade
Copy link
Contributor

LGTM and merged then, since we already have the other test.

@@ -2,7 +2,7 @@ package scala.quoted

import scala.runtime.quoted.Unpickler.Pickled

sealed abstract class Expr[T] {
sealed abstract class Expr[+T] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd make sense to make the subclasses covariant too for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add apt them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #4896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants